<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>CodeMirror: xu mode</title>
    <link rel="stylesheet" href="../../lib/codemirror.css">
    <script src="../../lib/codemirror.js"></script>
    <script src="mscgen.js"></script>
    <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  </head>
  <body>
    <h1>CodeMirror: xù mode</h1>

<div><textarea id="code">
# test50 - expansions to mscgen to support inline expressions
#          for now in a separate language: xù
msc {

  hscale="0.8",
  width="700";

  a,
  b [label="change store"],
  c,
  d [label="necro queue"],
  e [label="natalis queue"],
  f;

  a =>> b [label="get change list()"];
  a alt f [label="changes found"] { /* alt is a xu specific keyword*/
    b >> a [label="list of changes"];
    a =>> c [label="cull old stuff (list of changes)"];
    b loop e [label="for each change"] { // loop is xu specific as well...
      /*
       * Here interesting stuff happens.
       * TBD
       */
      c =>> b [label="get change()"];
      b >> c [label="change"];
      c alt e [label="change too old"] {
        c =>> d [label="queue(change)"];
        --- [label="change newer than latest run"];
        c =>> e [label="queue(change)"];
        --- [label="all other cases"];
        ||| [label="leave well alone"];
      };
    };
    
    
    c >> a [label="done
    processing"];
    
    /* shucks! nothing found ...*/
    --- [label="nothing found"];
    b >> a [label="nothing"];
    a note a [label="silent exit"];
  };
}
</textarea></div>

    <script>
      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
        lineNumbers: true,
        mode: "xu",
      });
    </script>

    <p><strong>MIME types defined:</strong> <code>text/x-xu</code></p>
  </body>
</html>
